SQL in easy steps 4th Edition by Mike McGrath
Author:Mike McGrath
Language: eng
Format: epub
Publisher: In Easy Steps
Published: 2020-06-21T16:00:00+00:00
Comparing alternative lists
A WHERE clause in a SELECT query can specify a list of alternative values for comparison with column data using the IN keyword. This is followed by a comma-separated list of values within a single pair of parentheses. The syntax looks like this:
SELECT data FROM table-name
WHERE column IN ( value , value , value ) ;
When the column data matches any one of the values in the list, the WHERE clause evaluates as true, and data is returned for that row. The comparison can be inverted by preceding the IN keyword with the NOT keyword. Then, the WHERE clause only evaluates as true when no list value matches the column data.
The SQL script listed below demonstrates the comparison of multiple values using both IN and NOT IN clauses:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Access | Data Mining |
Data Modeling & Design | Data Processing |
Data Warehousing | MySQL |
Oracle | Other Databases |
Relational Databases | SQL |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8299)
Azure Data and AI Architect Handbook by Olivier Mertens & Breght Van Baelen(6737)
Building Statistical Models in Python by Huy Hoang Nguyen & Paul N Adams & Stuart J Miller(6713)
Serverless Machine Learning with Amazon Redshift ML by Debu Panda & Phil Bates & Bhanu Pittampally & Sumeet Joshi(6588)
Data Wrangling on AWS by Navnit Shukla | Sankar M | Sam Palani(6375)
Driving Data Quality with Data Contracts by Andrew Jones(6322)
Machine Learning Model Serving Patterns and Best Practices by Md Johirul Islam(6086)
Learning SQL by Alan Beaulieu(5995)
Weapons of Math Destruction by Cathy O'Neil(5779)
Big Data Analysis with Python by Ivan Marin(5362)
Data Engineering with dbt by Roberto Zagni(4359)
Solidity Programming Essentials by Ritesh Modi(4008)
Time Series Analysis with Python Cookbook by Tarek A. Atwan(3866)
Pandas Cookbook by Theodore Petrou(3577)
Blockchain Basics by Daniel Drescher(3294)
Hands-On Machine Learning for Algorithmic Trading by Stefan Jansen(2905)
Feature Store for Machine Learning by Jayanth Kumar M J(2814)
Learn T-SQL Querying by Pam Lahoud & Pedro Lopes(2796)
Mastering Python for Finance by Unknown(2744)
